<%-- 
    Document   : AdicionaDisciplina
    Created on : 04/12/2011, 09:48:16
    Author     : Rennan
--%>

<%@page import="br.com.ufpb.halloc.negocio.Disciplina"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="br.com.ufpb.halloc.negocio.Professor"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Adiciona Disciplina</title>
        <style type="text/css">
            div#back {
                background-color: lightsteelblue;
                height: auto;
                margin-top: 0px;
                margin-left: 170px;
                margin-right: 170px;
            }
            div#form {
                background-color: #DDD;
                font: 14px Verdana, sans-serif;
                height: 60px;
                margin-top: 5px;
                border: 1px solid #696969;
                margin-left: 100px;
                margin-right: 100px;
            }
            
            div#campos, div#form {
                color: #333;
            }
                
            #tab_customizada
            {
                font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
                width:100%;
                border-collapse:collapse;
            }
            #tab_customizada td, #tab_customizada th 
            {
                font: 14px Verdana, sans-serif;
                border:2px solid #98bf21;
                padding:3px 7px 2px 7px;
                color: #000000;
            }
            #tab_customizada th 
            {
                font: 16px Verdana, sans-serif;
                text-align:center;
                padding-top:5px;
                padding-bottom:4px;
                background-color:#369;
                color:#fff;
            }
            #tab_customizada tr.alt td 
            {
                color:#000000;
                background-color: #EAF2D3;
            }

        </style>
    </head>
    
    <body>
        <jsp:include page="menubarra.jsp"></jsp:include>        
            <br><br>
        <% Professor p = (Professor) request.getAttribute("professor");%>
        <div id="back">
            <div align="center">Olá <%out.println(p.getNome());%></div>
            <br>
            <div align="center">Escolha as disiplinas de sua preferência:</div>
            <br><br>
            ${done}
            <br>
            <div align="center">${done}</div>
            <div align="center">${fail}</div>
            <div align="center">
                <table id="tab_customizada" border="1">
                    <tr>
                        <th>Código</th>
                        <th>Nome</th>
                        <th>Créditos</th>
                        <th>Escolher:</th>
                    </tr>
                    <% //buscar disciplinas cadastradas
                        List<Disciplina> disciplinas = new ArrayList<Disciplina>();
        
                        disciplinas = (List<Disciplina>) request.getAttribute("disciplinas");
        
                        if (disciplinas != null) {
                            for (Disciplina d : disciplinas) { %>
                                <tr>
                                    <td> <%=d.getID()%></td>
                                    <td><%=d.getNome()%></td>
                                    <td><%=d.getCreditos()%></td>
                                    <td><a href="Preferencia.jsp?did=<%=d.getID()%>&mat=<%=p.getMatricula()%>">Esta</a></td>
                                </tr>
                    <%          
                            }
                        }   
                    %>
                </table>
            </div>
        </div>
    </body>
</html>
